#ifndef SKILL_H
#define SKILL_H


#include "dtwenty_global.h"
#include "dtwenty_defines.h"
#include "campaign.h"


#include <datacontainer.h>


#include <QSharedData>
#include <QSharedDataPointer>


class DTWENTYSHARED_EXPORT Skill : public DataContainer
{
    Q_OBJECT

    class Data : public QSharedData
    {
    public:

        Data()
        {
            attribute = Campaign::Strength;
        }
        Data(const Data& other) : QSharedData(other)
        {
            attribute = other.attribute;
        }

        QVariant attribute;
    };


    Q_PROPERTY(Campaign::Attribute attribute READ attribute WRITE setAttribute)


public:


    Q_INVOKABLE Skill(DataSuite *parent = 0);
    Skill(const Skill& other);

    Campaign::Attribute attribute() const;
    void setAttribute(Campaign::Attribute attribute);

    virtual int internalFieldCount() const;

    virtual int fieldCount() const;
    virtual QVariant value(int field, int role) const;
    virtual bool setValue(int field, const QVariant &value, int role);



private:

    QSharedDataPointer<Data> d;
    
};


//Q_DECLARE_METATYPE(Skill::Attribute)
Q_DECLARE_METATYPE(Skill*)


#endif // SKILL_H
